Scheduling Discovery
Discovery can be triggered from within the web portal or can be scheduled to run at regular intervals using the Windows Task Scheduler. The discovered CIs and their details are imported into CMDB and made available for integration with other applications via Webhooks.
Prerequisites to scheduling discovery:
-
Be sure cloud regions are populated for the provider.
-
Set up a credential and discovery profile for the provider.
Steps to schedule discovery using the Windows Task Scheduler:
-
Edit the following PowerShell script to include your API token and the ID of your profile.
$headers = @{
'apitoken' = 'e257a5b9-383f-cced-ccb0-223d48555a3d'
'ContentType' = 'application/json'
}
$body = @{
ID=1
}
Invoke-RestMethod -Headers $headers -Method POST -Uri http://localhost/cgrestapi/api/discovery/profile -Body ($body|ConvertTo-Json)
Note: The URL scheme and authority need to be replaced to match your environment.
-
In the Windows Task Scheduler, create a task to set up the script to run at your desired interval.